package com.example.dayu521.sg_oss.controller.exception;

import org.example.dayu521.ORExecption;
import org.example.dayu521.OrRes;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@ControllerAdvice(annotations = RestController.class)
public class ORExceptionController {

    @ExceptionHandler(ORExecption.class)
    @ResponseBody
    OrRes<?> h(ORExecption e){
        return (OrRes<?>) e.getOR();
    }
}
